blob: 9830da4598de8ca52da4d5f935836e1640448f7b [file] [log] [blame]
Nathanael Nerode748503c2002-10-01 22:34:161# Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
2# 1999, 2000, 2001, 2002 Free Software Foundation
3#
4# This file is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation; either version 2 of the License, or
7# (at your option) any later version.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with this program; if not, write to the Free Software
16# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17#
18
19# This Makefile contains release scripts for gdb, binutils, and other
20# packages which live in src. It used to be part of the top level Makefile,
21# but that turned out to be very messy and hard to maintain.
22
23# This stuff really ought to be cleaned up and turned into something other
24# than a Makefile. As it is it's heavily recursive.
25
26# This is the name of this script (!). Needed due to horrible recursion.
27SELF = src-release
28
29SHELL = /bin/sh
30
31BZIPPROG = bzip2
32MD5PROG = md5sum
33
34# pwd command to use. Allow user to override default by setting PWDCMD in
35# the environment to account for automounters. The make variable must not
36# be called PWDCMD, otherwise the value set here is passed to make
37# subprocesses and overrides the setting from the user's environment.
38PWD = $${PWDCMD-pwd}
39
40#
41# Support for building net releases
42
43# Files in devo used in any net release.
44# ChangeLog omitted because it may refer to files which are not in this
45# distribution (perhaps it would be better to include it anyway).
46DEVO_SUPPORT= README Makefile.in configure configure.in \
47config.guess config.if config.sub config move-if-change \
48mpw-README mpw-build.in mpw-config.in mpw-configure mpw-install \
49COPYING COPYING.LIB install-sh config-ml.in symlink-tree \
50mkinstalldirs ltconfig ltmain.sh missing ylwrap \
51libtool.m4 gettext.m4 ltcf-c.sh ltcf-cxx.sh ltcf-gcj.sh
52
53# Files in devo/etc used in any net release.
54# ChangeLog omitted because it may refer to files which are not in this
55# distribution (perhaps it would be better to include it anyway).
56ETC_SUPPORT= Makefile.in configure configure.in standards.texi \
57make-stds.texi standards.info* configure.texi configure.info* \
58configbuild.* configdev.*
59
60
61# When you use `make setup-dirs' or `make taz' you should always redefine
62# this macro.
63SUPPORT_FILES = list-of-support-files-for-tool-in-question
64
65# NOTE: No double quotes in the below. It is used within shell script
66# as VER="$(VER)"
67VER = ` if grep 'AM_INIT_AUTOMAKE.*BFD_VERSION' $(TOOL)/configure.in >/dev/null 2>&1; then \
68 sed < bfd/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \
69elif grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \
70 sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \
71elif test -f $(TOOL)/version.in; then \
72 head -1 $(TOOL)/version.in; \
73elif grep VERSION $(TOOL)/Makefile.in > /dev/null 2>&1; then \
74 sed < $(TOOL)/Makefile.in -n 's/^VERSION *= *//p'; \
75else \
76 echo VERSION; \
77fi`
78PACKAGE = $(TOOL)
79
80.PHONY: taz
81taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
82$(MAKE) -f $(SELF) do-proto-toplev \
83TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
84MD5PROG="$(MD5PROG)" \
85SUPPORT_FILES="$(SUPPORT_FILES)"
86$(MAKE) -f $(SELF) do-md5sum \
87TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
88MD5PROG="$(MD5PROG)" \
89SUPPORT_FILES="$(SUPPORT_FILES)"
90$(MAKE) -f $(SELF) do-tar \
91TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
92MD5PROG="$(MD5PROG)" \
93SUPPORT_FILES="$(SUPPORT_FILES)"
94$(MAKE) -f $(SELF) do-bz2 \
95TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
96MD5PROG="$(MD5PROG)" \
97SUPPORT_FILES="$(SUPPORT_FILES)"
98
99.PHONY: gdb-tar
100gdb-tar: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
101$(MAKE) -f $(SELF) do-proto-toplev \
102TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
103MD5PROG="$(MD5PROG)" \
104SUPPORT_FILES="$(SUPPORT_FILES)"
105$(MAKE) -f $(SELF) do-md5sum \
106TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
107MD5PROG="$(MD5PROG)" \
108SUPPORT_FILES="$(SUPPORT_FILES)"
109$(MAKE) -f $(SELF) do-djunpack \
110TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
111MD5PROG="$(MD5PROG)" \
112SUPPORT_FILES="$(SUPPORT_FILES)"
113$(MAKE) -f $(SELF) do-tar \
114TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
115MD5PROG="$(MD5PROG)" \
116SUPPORT_FILES="$(SUPPORT_FILES)"
117
118.PHONY: gdb-taz
119gdb-taz: gdb-tar $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
120$(MAKE) -f $(SELF) gdb-tar \
121TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
122MD5PROG="$(MD5PROG)" \
123SUPPORT_FILES="$(SUPPORT_FILES)"
124$(MAKE) -f $(SELF) do-bz2 \
125TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
126MD5PROG="$(MD5PROG)" \
127SUPPORT_FILES="$(SUPPORT_FILES)"
128
129.PHONY: do-proto-toplev
130do-proto-toplev: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
131echo "==> Making $(PACKAGE)-$(VER)/"
132# Take out texinfo from a few places.
133sed -e '/^all\.normal: /s/\all-texinfo //' \
134 -e '/^ install-texinfo /d' \
135<Makefile.in >tmp
136mv -f tmp Makefile.in
137#
138./configure sun4
139$(MAKE) configure-target \
140 ALL_GCC="" ALL_GCC_C="" ALL_GCC_CXX="" \
141 CC_FOR_TARGET="$(CC)" CXX_FOR_TARGET="$(CXX)"
142# Make links, and run "make diststuff" or "make info" when needed.
143rm -rf proto-toplev ; mkdir proto-toplev
144set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
145for d in $$dirs ; do \
146 if [ -d $$d ]; then \
147 if [ ! -f $$d/Makefile ] ; then true ; \
148 elif grep '^diststuff:' $$d/Makefile >/dev/null ; then \
149(cd $$d ; $(MAKE) diststuff ) || exit 1 ; \
150 elif grep '^info:' $$d/Makefile >/dev/null ; then \
151 (cd $$d ; $(MAKE) info ) || exit 1 ; \
152 fi ; \
153 if [ -d $$d/proto-$$d.dir ]; then \
154 ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
155 else \
156 ln -s ../$$d proto-toplev/$$d ; \
157 fi ; \
158 else ln -s ../$$d proto-toplev/$$d ; fi ; \
159done
160cd etc && $(MAKE) info
161$(MAKE) distclean
162#
163mkdir proto-toplev/etc
164(cd proto-toplev/etc; \
165 for i in $(ETC_SUPPORT); do \
166ln -s ../../etc/$$i . ; \
167 done)
168#
169# Take out texinfo from configurable dirs
170rm proto-toplev/configure.in
171sed -e '/^host_tools=/s/texinfo //' \
172 <configure.in >proto-toplev/configure.in
173#
174mkdir proto-toplev/texinfo
175ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
176if test -r texinfo/util/tex3patch ; then \
177 mkdir proto-toplev/texinfo/util && \
178 ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \
179else true; fi
180chmod -R og=u . || chmod og=u `find . -print`
181#
182# Create .gmo files from .po files.
183for f in `find . -name '*.po' -type f -print`; do \
184 msgfmt -o `echo $$f | sed -e 's/\.po$$/.gmo/'` $$f ; \
185done
186#
187-rm -f $(PACKAGE)-$(VER)
188ln -s proto-toplev $(PACKAGE)-$(VER)
189
190.PHONY: do-tar
191do-tar:
192echo "==> Making $(PACKAGE)-$(VER).tar"
193-rm -f $(PACKAGE)-$(VER).tar
194find $(PACKAGE)-$(VER) -follow -name CVS -prune -o -type f -print \
195| tar cTfh - $(PACKAGE)-$(VER).tar
196
197.PHONY: do-bz2
198do-bz2:
199echo "==> Bzipping $(PACKAGE)-$(VER).tar.bz2"
200-rm -f $(PACKAGE)-$(VER).tar.bz2
201$(BZIPPROG) -v -9 $(PACKAGE)-$(VER).tar
202
203.PHONY: do-md5sum
204do-md5sum:
205echo "==> Adding md5 checksum to top-level directory"
206cd proto-toplev && find * -follow -name CVS -prune -o -type f -print \
207| xargs $(MD5PROG) > ../md5.sum
208mv md5.sum proto-toplev
209
210.PHONY: do-djunpack
211do-djunpack:
212echo "==> Adding updated djunpack.bat to top-level directory"
213echo - 's /gdb-[0-9\.]*/gdb-'"$(VER)"'/'
214sed < djunpack.bat > djunpack.new \
215-e 's/gdb-[0-9][0-9\.]*/gdb-'"$(VER)"'/'
216mv djunpack.new djunpack.bat
217-rm -f proto-toplev/djunpack.bat
218ln -s ../djunpack.bat proto-toplev/djunpack.bat
219
220TEXINFO_SUPPORT= texinfo/texinfo.tex
221DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
222
223.PHONY: gas.tar.bz2
224GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms mkdep
225gas.tar.bz2: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
226$(MAKE) -f $(SELF) taz TOOL=gas \
227MD5PROG="$(MD5PROG)" \
228SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
229
230# The FSF "binutils" release includes gprof and ld.
231.PHONY: binutils.tar.bz2
Nathanael Nerode7aa673e2002-10-01 22:58:14232BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof intl setup.com makefile.vms mkdep cpu
Nathanael Nerode748503c2002-10-01 22:34:16233binutils.tar.bz2: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
234$(MAKE) -f $(SELF) taz TOOL=binutils \
235MD5PROG="$(MD5PROG)" \
236SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)"
237
238.PHONY: gas+binutils.tar.bz2
239GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
240gas+binutils.tar.bz2: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
241$(MAKE) -f $(SELF) taz TOOL=gas \
242MD5PROG="$(MD5PROG)" \
243SUPPORT_FILES="$(GASB_SUPPORT_DIRS)"
244
245GNATS_SUPPORT_DIRS=include libiberty send-pr
246gnats.tar.bz2: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
247$(MAKE) -f $(SELF) taz TOOL=gnats \
248MD5PROG="$(MD5PROG)" \
249SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
250
251.PHONY: gdb.tar.bz2
252GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils intl
253gdb.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
254$(MAKE) -f $(SELF) gdb-taz TOOL=gdb \
255MD5PROG="$(MD5PROG)" \
256SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
257.PHONY: gdb.tar
258gdb.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
259$(MAKE) -f $(SELF) gdb-tar TOOL=gdb \
260MD5PROG="$(MD5PROG)" \
261SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
262
263DEJAGNU_SUPPORT_DIRS= tcl expect libiberty
264.PHONY: dejagnu.tar.bz2
265dejagnu.tar.bz2: $(DIST_SUPPORT) $(DEJAGNU_SUPPORT_DIRS) dejagnu
266$(MAKE) -f $(SELF) taz TOOL=dejagnu \
267MD5PROG="$(MD5PROG)" \
268SUPPORT_FILES="$(DEJAGNU_SUPPORT_DIRS)"
269
270.PHONY: gdb+dejagnu.tar.bz2
271GDBD_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl expect dejagnu
272gdb+dejagnu.tar.bz2: $(DIST_SUPPORT) $(GDBD_SUPPORT_DIRS) gdb
273$(MAKE) -f $(SELF) gdb-taz TOOL=gdb PACKAGE=gdb+dejagnu \
274MD5PROG="$(MD5PROG)" \
275SUPPORT_FILES="$(GDBD_SUPPORT_DIRS)"
276.PHONY: gdb+dejagnu.tar
277gdb+dejagnu.tar: $(DIST_SUPPORT) $(GDBD_SUPPORT_DIRS) gdb
278$(MAKE) -f $(SELF) gdb-tar TOOL=gdb PACKAGE=gdb+dejagnu \
279MD5PROG="$(MD5PROG)" \
280SUPPORT_FILES="$(GDBD_SUPPORT_DIRS)"
281
282.PHONY: insight.tar.bz2
283INSIGHT_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl tk itcl tix libgui
284insight.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
285$(MAKE) -f $(SELF) gdb-taz TOOL=gdb PACKAGE=insight \
286MD5PROG="$(MD5PROG)" \
287SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
288.PHONY: insight.tar
289insight.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
290$(MAKE) -f $(SELF) gdb-tar TOOL=gdb PACKAGE=insight \
291MD5PROG="$(MD5PROG)" \
292SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
293
294.PHONY: insight+dejagnu.tar.bz2
295INSIGHTD_SUPPORT_DIRS= $(INSIGHT_SUPPORT_DIRS) expect dejagnu
296insight+dejagnu.tar.bz2: $(DIST_SUPPORT) $(INSIGHTD_SUPPORT_DIRS) gdb
297$(MAKE) -f $(SELF) gdb-taz TOOL=gdb PACKAGE="insight+dejagnu" \
298MD5PROG="$(MD5PROG)" \
299SUPPORT_FILES="$(INSIGHTD_SUPPORT_DIRS)"
300.PHONY: insight+dejagnu.tar
301insight+dejagnu.tar: $(DIST_SUPPORT) $(INSIGHTD_SUPPORT_DIRS) gdb
302$(MAKE) -f $(SELF) gdb-tar TOOL=gdb PACKAGE="insight+dejagnu" \
303MD5PROG="$(MD5PROG)" \
304SUPPORT_FILES="$(INSIGHTD_SUPPORT_DIRS)"
305
306.PHONY: newlib.tar.bz2
307NEWLIB_SUPPORT_DIRS=libgloss
308# taz configures for the sun4 target which won't configure newlib.
309# We need newlib configured so that the .info files are made.
310# Unfortunately, it is not enough to just configure newlib separately:
311# taz will build the .info files but since SUBDIRS won't contain newlib,
312# distclean won't be run (leaving Makefile, config.status, and the tmp files
313# used in building the .info files, eg: *.def, *.ref).
314# The problem isn't solvable however without a lot of extra work because
315# target libraries are built in subdir $(target_alias) which gets nuked during
316# the make distclean. For now punt on the issue of shipping newlib info files
317# with newlib net releases and wait for a day when some native target (sun4?)
318# supports newlib (if only minimally).
319newlib.tar.bz2: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
320$(MAKE) -f $(SELF) taz TOOL=newlib \
321MD5PROG="$(MD5PROG)" \
322SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
323DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" newlib
324
325.NOEXPORT:
326MAKEOVERRIDES=